package com.hq.hotl.controller;

import com.hq.hotl.pojo.Enter;
import com.hq.hotl.service.EnterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;
import java.util.Map;

@Controller
public class EnterController {
    @Autowired
    private EnterService enterService;

    /*
    * 查询订单
    * */
    @RequestMapping("/personalcenter")
    public String queryAll(String username ,ModelMap modelMap){
        List<Object> enter = enterService.queryAll(username);
        modelMap.put("enterM",enter);
        return "order";
    }

    @RequestMapping("/queryAllByState")
    public String queryAllByState(int state,ModelMap modelMap){
        List<Enter> enters = enterService.queryAllByState(state);
        modelMap.put("enters",enters);
        return "orderManager";
    }
}
